var Button = Angel.extend({
	margin: 10,
	ctor: function (parent,zIndex,tag,fileName,callback,back,rect,rotated) {
		this._super(parent, fileName, callback, back, rect, rotated);
		this.setTag(tag);
		this.setLocalZOrder(zIndex);
	},
	up:function (standard, margin){
		if(margin != null){
			this.margin = margin;
		}
		this.setPosition(standard.x, standard.y + standard.height + this.margin);
	},
	down:function (standard, margin){
		if(margin != null){
			this.margin = margin;
		}
		this.setPosition(standard.x, standard.y - this.height - this.margin);
	},
	left:function (standard, margin){
		if(margin != null){
			this.margin = margin;
		}
		this.setPosition(standard.x - this.width - this.margin, standard.y);
	},
	right:function (standard, margin){
		if(margin != null){
			this.margin = margin;
		}
		this.setPosition(standard.x + standard.width + this.margin, standard.y);
	},
	flash:function (){
		if(teach_type != TAG_LEAD){
			return;
		}
		var fade1 = cc.fadeTo(0.5, 50);
		var fade2 = cc.fadeTo(0.5, 255);
		var seq = cc.sequence(fade1,fade2);
		var flash = cc.RepeatForever.create(seq);
		this.runAction(flash);
	},
	stop:function (){
		this.stopAllActions();
		this.setOpacity(255);
	}
});